Hệ thống bổ nhiệm bác sĩ trong PHP bằng mã nguồn

1 <?php include('header.php'); ?>
2
3
4
5
6
7     <!--
this is for donor registraton -->
8     <div
class="recipient_reg" style="background-color:#272327;">
9         <h3
class="text-center" style="background-color:#272327;color: #fff;">Patient Registration</h3>
10
11         <div
class="formstyle" style="float: right;padding:25px;border: 1px solid lightgrey;margin-right:415px; margin-bottom:30px;background-color:#f3f3f8;color:#141313;">
12         <form enctype=
"multipart/form-data" method="post" class="text-center">
13              <div
class="col-md-12">
14                   
15                     <label>
16                         Your Name: <input type=
"text" name="name" value="" placeholder="Full name" required>
17                     </label><br><br>
18
19                     <label>
20                         Age: <input type=
"number" name="age" placeholder="age" pattern="[0-9]{2,2}" title="please enter only numbers between 2 to 2 for age"/>
21                     </label><br><br>
22                     <label>
23                         Mobile: <input type=
"number" name="contact" placeholder="contact no" required="required" pattern="[0-9]{10,11}" title="please enter only numbers between 10 to 11 for mobile no."/>
24                     </label><br><br>
25                     
26                     <label>
27                         Address: <input type=
"text" name="address" value="" placeholder="address">
28                     </label><br><br>
29                     <label>
30                         Blood Group: <
select name="bgroup" required>
31                                         <option
value="">-select-</option>
32                                         <option
value="O+">O+</option>
33                                         <option
value="O-">O-</option>
34                                         <option
value="AB+">AB+</option>
35                                         <option
value="AB-">AB-</option>
36                                         <option
value="A+">A+</option>
37                                         <option
value="A-">A-</option>
38                                         <option
value="B+">B+</option>
39                                         <option
value="B-">B-</option>
40                                     </
select>
41                     </label><br><br>
42                     <label>
43                         Email: <input type=
"email" name="email" value="" placeholder="email" required>
44                     </label><br><br>
45                     <label>
46                         Password: <input type=
"password" name="password" value="" placeholder="password" required>
47                     </label><br><br>
48                     
49                     
50                     <button name=
"submit" type="submit" style="margin-left:60px;width: 85px;border-radius: 3px;">Register</button> <br>
51                 
52             </div> <!-- col-md-
12 -->
53
54
55                 </form>
56             </div>
57
58
59
60
61     </div>
62     
63     
64
65
66
67     
68     
69  <?php include(
'footer.php'); ?>
70
71
72     
73     </div><!-- containerFluid Ends -->
74
75
76
77
78     <script src=
"js/bootstrap.min.js"></script>
79
80
81      <!-- validation and insertion -->
82
83
84                 <?php
85                         include(
'config.php');
86                         
if(isset($_POST['submit'])){
87
88                         $sql1 =
"SELECT * FROM patient WHERE email='".$_POST["email"]."' ";
89                         $result = $conn->query($sql1);
90                         
if ($result->num_rows > 0) {
91                               echo
"<script>alert('Sorry, user already exist!');</script>";
92                          }
93                         
else{
94                             $sql =
"INSERT INTO patient (name,age,contact,address,bgroup,email, password)
95                             VALUES ('"
. $_POST["name"] ."','" . $_POST["age"] . "','" . $_POST["contact"] . "','" . $_POST["address"] . "','" . $_POST["bgroup"] . "', '" . $_POST["email"] . "','" . $_POST["password"] . "' )";
96
97                             
if ($conn->query($sql) === TRUE) {
98                                 echo
"<script>location.replace('patient_success_msg.php');</script>";
99                             }
else {
100                                 echo
"<script>alert('There was an Error')<script>" . $sql . "<br>" . $conn->error;
101                             }
102
103                             $conn->close();
104                         }
105                     }
106                 ?>
107
108
109
110     <!-- validation and insertion End-->
111
112
113
114 </body>
115 </html>


Gõ tìm kiếm nhanh...